import { request } from 'umi';

export async function createUser(body, options) {
  return request('/api/myapp/user', {
    method: 'POST',
    data: body,
    ...(options || {}),
  });
}
export function getUser(body, options) {
  return request('/api/myapp/user?page=1&pagesize=5', {
    method: 'GET',
    data: body,
    ...(options || {}),
  });
}
export function deleteUser(body, options) {
  return request(`/api/myapp/user?id=${body}`, {
    method: 'DELETE',
    ...(options || {}),
  });
}
export function updateUser(body, options) {
  return request(`/api/myapp/user`, {
    method: 'PUT',
    data: body,
    ...(options || {}),
  });
}
export function getDepartment(body, options) {
  return request(`/api/myapp/department `, {
    method: 'GET',
    data: body,
    ...(options || {}),
  });
}
